package com.changgou.goods.dao;

import com.changgou.entity.Result;
import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.GetMapping;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    /**
     *根据商品分类名称查询规格列表
     * @param Categoryname  分类名称
     * @return  规格列表
     */
    @Select("SELECT * FROM tb_spec WHERE template_id IN (SELECT template_id FROM tb_category WHERE NAME=#{Categoryname})")
    public List<Map> FindSpecByCategoryname(@Param("Categoryname") String Categoryname);

}
